<?php

namespace Admin\Models\hrm;

class XhhrmResource extends basicModel
{

    /**
     *
     * @var integer
     * @Primary
     * @Identity
     * @Column(type="integer", length=11, nullable=false)
     */
    public $iStaffId;

    public $sChargeDeps;

    /**
     * @var int
     * @Column(type="integer", length=11, nullable=true)
     */
    public $iStaffStatus;

    /**
     * @var int
     * @Column(type="integer", length=11, nullable=true)
     */
    public $iOfferStatus;

    /**
     * @var int
     * @Column(type="integer", length=11, nullable=true)
     */
    public $iStaffLevel;

    /**
     *
     * @var integer
     * @Column(type="integer", length=11, nullable=true)
     */
    public $iUserId;

    /**
     *
     * @var string
     * @Column(type="string", length=100, nullable=true)
     */
    public $sStaffName;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $sDepIds;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $tBirthday;

    /**
     *
     * @var string
     * @Column(type="string", length=100, nullable=true)
     */
    public $sPrIcon;

    /**
     *
     * @var integer
     * @Column(type="integer", length=1, nullable=true)
     */
    public $iUserSex;

    /**
     *
     * @var string
     * @Column(type="string", length=50, nullable=true)
     */
    public $sBankCard;

    /**
     *
     * @var integer
     * @Column(type="integer", length=1, nullable=true)
     */
    public $bMarried;

    /**
     *
     * @var string
     * @Column(type="string", length=50, nullable=true)
     */
    public $sNationName;

    /**
     *
     * @var string
     * @Column(type="string", length=20, nullable=true)
     */
    public $sNativePlace;

    /**
     *
     * @var string
     * @Column(type="string", length=20, nullable=true)
     */
    public $sIdentityCode;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $tStartWork;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $tRegularDate;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $tHireDate;

    /**
     *
     * @var string
     * @Column(type="string", length=50, nullable=true)
     */
    public $sContractStatus;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $sContentDate;

    /**
     *
     * @var integer
     * @Column(type="integer", length=4, nullable=true)
     */
    public $iSignNumber;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $sPostLevel;

    /**
     *
     * @var string
     * @Column(type="string", length=50, nullable=true)
     */
    public $sPostName;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $tSocialPayDate;

    /**
     *
     * @var string
     * @Column(type="string", length=50, nullable=true)
     */
    public $sSocialPayStatus;

    /**
     *
     * @var integer
     * @Column(type="integer", length=4, nullable=true)
     */
    public $bInHoliday;

    /**
     *
     * @var integer
     * @Column(type="integer", length=11, nullable=true)
     */
    public $iStatus;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $tGraduateDate;

    /**
     *
     * @var string
     * @Column(type="string", length=50, nullable=true)
     */
    public $sProfession;

    /**
     *
     * @var string
     * @Column(type="string", length=100, nullable=true)
     */
    public $sGraduateSchool;

    /**
     *
     * @var string
     * @Column(type="string", length=20, nullable=true)
     */
    public $sCultureLevel;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $sSurplusPayStatus;

    /**
     *
     * @var string
     * @Column(type="string", length=20, nullable=true)
     */
    public $sSelfPhone;

    /**
     *
     * @var string
     * @Column(type="string", length=20, nullable=true)
     */
    public $sContractName;

    /**
     *
     * @var string
     * @Column(type="string", length=20, nullable=true)
     */
    public $sContractRelation;

    /**
     *
     * @var string
     * @Column(type="string", length=20, nullable=true)
     */
    public $sContractPhone;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $sFamilyAddress;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $sNowAddress;

    /**
     *
     * @var integer
     * @Column(type="integer", length=20, nullable=true)
     */
    public $sQQNum;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $sWeChatNum;

    /**
     *
     * @var string
     * @Column(type="string", length=50, nullable=true)
     */
    public $sEmailAddress;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $sRemark;

    /**
     *
     * @var integer
     * @Column(type="integer", length=4, nullable=true)
     */
    public $bDelete;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $tCreateDate;

    /**
     *
     * @var string
     * @Column(type="string", length=11, nullable=true)
     */
    public $iCreateUserId;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $tLastModifyDate;

    /**
     *
     * @var string
     * @Column(type="string", length=11, nullable=true)
     */
    public $iLastModifyUserId;


    /**
     * @var int
     */
    public $iState;

    /**
     * @var string
     */
    public $sTime;

    /**
     * @var string
     */
    public $tTime;

    /**
     * @var integer
     *
     */
    public $iEmploySource;

    /**
     * @var integer
     *
     */
    public $iRecStaff;

    /**
     * @var string
     *
     */
    public $sMaxHire;

    /**
     * @var integer
     */
    public $bCarPlate;

    /**
     * @var string
     */
    public $sUseCar;

    /**
     * @var integer
     */
    public $bEvection;

    /**
     * @var string
     */
    public $mHealth;

    /**
     * @var string
     */
    public $mEvaluate;

    /**
     * @var integer
     */
    public $iCarVeteran;
    /**
     * @var string
     */
    public $sCurMoSalary;
    /**
     * @var string
     */
    public $sCurYeSalary;
    /**
     * @var string
     */
    public $sHpMoSalary;
    /**
     * @var string
     */
    public $sHpYeSalary;

    /**
     * @var string
     */
    public $sProbationSalary;

    /**
     * @var string
     */
    public $sRegularSalary;

    /**
     * @var integer
     */
    public $iRegisterType;

    /**
     * @var string
     */
    public $sProbationDate;

    /**
     * @var string
     * create by dale 20181031
     */
    public $mSignature;

    /**
     * @var string
     * create by dale 20181109
     */
    public $mToken;

    /**
     * 邀约面试时间
     *
     * @var string
     * create by dale 20190226
     */
    public $sInterTime;

    /**
     * 发送未录取短信
     *
     * @var integer
     * create by dale 20190226
     */
    public $bSendDisqualify;

    /**
     * 发送邀约短信
     *
     * @var integer
     * create by dale 20190226
     */
    public $bSendInvite;



    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        $this->setSource("XHHrm_Rescource");
    }

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'XHHrm_Rescource';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return XhhrmResource[]|XhhrmResource
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return XhhrmResource
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }


    public function afterFetch()
    {
        $this->tHireDate =  date('Y-m', strtotime($this->tHireDate));
        $this->tRegularDate = date('Y-m', strtotime($this->tRegularDate));
        $this->tSocialPayDate = date('Y-m', strtotime($this->tSocialPayDate));
        return true;
    }


    public function beforeSave()
    {
        $this->tHireDate = $this->tHireDate ? $this->tHireDate.'-01' : null;
        $this->tRegularDate = $this->tRegularDate ? $this->tRegularDate.'-01' : null;
        $this->tSocialPayDate = $this->tSocialPayDate ? $this->tSocialPayDate.'-01' : null;
        return true;
    }


}
